package com.future.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.future.domain.DTO.NotificationDTO;
import com.future.domain.Notification;
import com.future.domain.vo.CommentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NotificationMapper extends BaseMapper<Notification> {
    List<NotificationDTO> selectLikeNotificationDto(
            @Param("receiverId") Long receiverId,
            @Param("offset") int offset,
            @Param("pageSize") int pageSize);
    List<NotificationDTO> selectCommentNotificationDto( @Param("receiverId") Long receiverId,
                                                        @Param("offset") int offset,
                                                        @Param("pageSize") int pageSize);

    List<NotificationDTO> selectMarkNotificationDto( @Param("receiverId") Long receiverId,
                                                     @Param("offset") int offset,
                                                     @Param("pageSize") int pageSize);
    List<NotificationDTO> selectQuestionNotificationDto( @Param("receiverId") Long receiverId,
                                                         @Param("offset") int offset,
                                                         @Param("pageSize") int pageSize);
    List<NotificationDTO> selectAllNotificationDto( @Param("receiverId") Long receiverId,
                                                    @Param("offset") int offset,
                                                    @Param("pageSize") int pageSize);
    Integer countunreadNotification(@Param("receiverId") Long receiverId);
    void batchUpdateIsRead(@Param("ids") List<Long> ids);
    Integer selectCounts(@Param("type")String type,@Param("receiverId")Long receiverId);
    Long countNotification(@Param("receiverId")Long receiverId,
                           @Param("type")String type);
    NotificationDTO selectLikeNotificationDtoById(Long notificationId);
    NotificationDTO selectCommentNotificationDTOById(Integer targetTypeId,Long notificationId);
    NotificationDTO selectMarkNotificationDTOById(Long notificationId);
    NotificationDTO selectQuestionNotificationDTOById(Long notificationId);
    NotificationDTO selectAnnouncementNotificationDTOById(Long notificationId);
    String notificationType(Long notificationId);
    Integer targetId(Long notificationId);
    void deleteNotification(Long notification);

}
